version1 = "1.01"
version2 = "1.001"
def compareVersion(version1, version2):
    version1List=version1.split(".")
    version2List=version2.split(".")
    print(version1List)
    print(version2List)
    version1ListLen=len(version1List)
    version2ListLen=len(version2List)

    i,j=0,0
    while i<version1ListLen and j<version2ListLen:
        if version1List[i]=="":
            sub1=0
        else:
            sub1=int(version1List[i])
        if version2List[i]=="":
            sub2=0
        else:
            sub2=int(version2List[i])
        if sub1>sub2:
            return 1
        if sub1<sub2:
            return -1
        i+=1
        j+=1

        while i<version1ListLen:
            #i这部分还没有走完
            if int(version1List[i])!=0:
                return 1
            i+=1
        while j<version2ListLen:
            if int(version2List[j])!=0:
                return -1
            j+=1
    return 0
print(compareVersion(version1,version2))